import React from 'react'
import { useNavigate } from 'react-router-dom'

export default function Test() {
  const navigate = useNavigate()
  return (
    <h1>
      Test,
      <button
        onClick={() => {
          // navagate和Link默认都是添加历史记录
          // navigate('/login/3')
          navigate('/login?xxx=1#123123', {
            state: { name: 'zs' },
          })
        }}
      >
        toLogin
      </button>
    </h1>
  )
}
